import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
//导入全局样式表
import './assets/css/global.css'
import * as lodash from "lodash";

import axios from 'axios'

// axios.defaults.baseURL = 'https://www.liulongbin.top:8888/api/private/v1/'
axios.defaults.baseURL = '/admin-api'

//axios.defaults.baseURL = 'http://127.0.0.1:8084/'
//axios.defaults.baseURL = 'http://129.211.127.49:8084/'

// //设置axios为form-data
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
// axios.defaults.headers.get['Content-Type'] = 'application/x-www-form-urlencoded';
// //axios.defaults.headers.Authorization = window.sessionStorage.getItem('token')
// axios.defaults.transformRequest = [function (data) {
//  let ret = ''
//  for (let it in data) {
//   ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
//  }
//  return ret
// }]
//  //然后再修改原型链
//Vue.prototype.$axios = axios


// axios.defaults.headers.post['Content-Type'] = 'application/json';
// axios.defaults.headers.get['Content-Type'] = 'application/json';

// //在请求拦截器中增加请求头的内容
// axios.interceptors.request.use(config=> {
//   console.log(config)
//   config.headers.Authorization = window.sessionStorage.getItem('token')
//   return config
// })


Vue.prototype.$axios = axios
  /* 全局lodash */
Vue.prototype.$baseLodash = lodash;


Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
